#include "gui_engine.h"

/*
TFont *font;
float panel_r,panel_g,panel_b;
float back_r,back_g,back_b;
float text_r,text_g,text_b;
*/

GUI_engine::GUI_engine()
{
	panel_r = 210 / 255.0f;
	panel_g = 220 / 255.0f;
	panel_b = 240 / 255.0f;

	back_r = 60 / 255.0f;
	back_g = 80 / 255.0f;
	back_b = 120 / 255.0f;

	select_r = 240 / 255.0f;
	select_g = 220 / 255.0f;
	select_b = 120 / 255.0f;

	text_r = 8 / 255.0f;
	text_g = 2 / 255.0f;
	text_b = 1 / 255.0f;

	if(active_gui_engine==0)SetActive();

#ifdef SIGEL_SOUND
	gui_ch = new Channel();

	bnav = 0;
	bclick = 0;
#endif
}

GUI_engine::GUI_engine(const char *style)
{
	std::ifstream fs(style);

	fs.close();
	if(active_gui_engine==0)SetActive();
}

GUI_engine::~GUI_engine()
{
}

void GUI_engine::SetPanelColor(float r,float g,float b)
{
}

void GUI_engine::SetPanelColor(int r,int g,int b)
{
}


void GUI_engine::SetTextColor(float r,float g,float b)
{
}

void GUI_engine::SetTextColor(int r,int g,int b)
{
}

void GUI_engine::SetSelectColor(float r,float g,float b)
{
}

void GUI_engine::SetSelectColor(int r,int g,int b)
{
}

void GUI_engine::SetBackFaceColor(float r,float g,float b)
{
}

void GUI_engine::SetBackFaceColor(int r,int g,int b)
{
}

void GUI_engine::SetFont(TFont *fnt)
{
	font = fnt;
}

void GUI_engine::SetActive()
{
	active_gui_engine = this;
}

bool GUI_engine::isUseFont()
{
	return (font!=0);
}

void GUI_engine::FontStartDraw()
{
	if(font)
		font->StartDraw();
}

void GUI_engine::FontEndDraw()
{
	if(font)
		font->EndDraw();
}

#ifdef SIGEL_SOUND

void GUI_engine::SetClickSound(Sound *clicksnd)
{
	bclick = clicksnd;
}

void GUI_engine::SetNavSound(Sound *navsnd)
{
	bnav = navsnd;
}

void GUI_engine::PlayClickSound()
{
	if(bclick)
		gui_ch=bclick->Play();
}

void GUI_engine::PlayNavSound()
{
	if(bnav)
		gui_ch=bnav->Play();
}

#endif